/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package idea.model.qnrlibrary;


import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;


/**
 *
 * @author rejun001
 */
@Entity
@Table( name = "general_lov" )
@XmlRootElement
@NamedQueries( 
{
    @NamedQuery( name = "GeneralLov.findAll" , query = "SELECT g FROM GeneralLov g" ) ,
    @NamedQuery( name = "GeneralLov.findByLovCode" , query = "SELECT g FROM GeneralLov g WHERE g.lovCode = :lovCode" ) ,
    @NamedQuery( name = "GeneralLov.findByLovSequence" , query = "SELECT g FROM GeneralLov g WHERE g.lovSequence = :lovSequence" ) ,
    @NamedQuery( name = "GeneralLov.findByLovDefinition" , query = "SELECT g FROM GeneralLov g WHERE g.lovDefinition = :lovDefinition" ) ,
    @NamedQuery( name = "GeneralLov.findByDescription" , query = "SELECT g FROM GeneralLov g WHERE g.description = :description" ) ,
    @NamedQuery( name = "GeneralLov.findByComments" , query = "SELECT g FROM GeneralLov g WHERE g.comments = :comments" ) ,
    @NamedQuery( name = "GeneralLov.findByCreatedBy" , query = "SELECT g FROM GeneralLov g WHERE g.createdBy = :createdBy" ) ,
    @NamedQuery( name = "GeneralLov.findByDateCreated" , query = "SELECT g FROM GeneralLov g WHERE g.dateCreated = :dateCreated" ) ,
    @NamedQuery( name = "GeneralLov.findByModifiedBy" , query = "SELECT g FROM GeneralLov g WHERE g.modifiedBy = :modifiedBy" ) ,
    @NamedQuery( name = "GeneralLov.findByDateModified" , query = "SELECT g FROM GeneralLov g WHERE g.dateModified = :dateModified" ) ,
    @NamedQuery( name = "GeneralLov.findByGeneralLovId" , query = "SELECT g FROM GeneralLov g WHERE g.generalLovId = :generalLovId" )
} )
public class GeneralLov implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Basic( optional = false )
    @Column( name = "lov_code" )
    private String lovCode;
    @Basic( optional = false )
    @Column( name = "lov_sequence" )
    private short lovSequence;
    @Column( name = "lov_definition" )
    private String lovDefinition;
    @Column( name = "description" )
    private String description;
    @Column( name = "comments" )
    private String comments;
    @Basic( optional = false )
    @Column( name = "created_by" )
    private String createdBy;
    @Basic( optional = false )
    @Column( name = "date_created" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateCreated;
    @Column( name = "modified_by" )
    private String modifiedBy;
    @Column( name = "date_modified" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateModified;
    @Id
    @Basic( optional = false )
    @Column( name = "general_lov_id" )
    private String generalLovId;
    @JoinColumn( name = "lov_type" , referencedColumnName = "lov_type" )
    @ManyToOne( optional = false )
    private GeneralLovTm lovType;


    public GeneralLov()
    {
    }


    public GeneralLov( String generalLovId )
    {
        this.generalLovId = generalLovId;
    }


    public GeneralLov( String generalLovId , String lovCode , short lovSequence , String createdBy , Date dateCreated )
    {
        this.generalLovId = generalLovId;
        this.lovCode = lovCode;
        this.lovSequence = lovSequence;
        this.createdBy = createdBy;
        this.dateCreated = dateCreated;
    }


    public String getLovCode()
    {
        return lovCode;
    }


    public void setLovCode( String lovCode )
    {
        this.lovCode = lovCode;
    }


    public short getLovSequence()
    {
        return lovSequence;
    }


    public void setLovSequence( short lovSequence )
    {
        this.lovSequence = lovSequence;
    }


    public String getLovDefinition()
    {
        return lovDefinition;
    }


    public void setLovDefinition( String lovDefinition )
    {
        this.lovDefinition = lovDefinition;
    }


    public String getDescription()
    {
        return description;
    }


    public void setDescription( String description )
    {
        this.description = description;
    }


    public String getComments()
    {
        return comments;
    }


    public void setComments( String comments )
    {
        this.comments = comments;
    }


    public String getCreatedBy()
    {
        return createdBy;
    }


    public void setCreatedBy( String createdBy )
    {
        this.createdBy = createdBy;
    }


    public Date getDateCreated()
    {
        return dateCreated;
    }


    public void setDateCreated( Date dateCreated )
    {
        this.dateCreated = dateCreated;
    }


    public String getModifiedBy()
    {
        return modifiedBy;
    }


    public void setModifiedBy( String modifiedBy )
    {
        this.modifiedBy = modifiedBy;
    }


    public Date getDateModified()
    {
        return dateModified;
    }


    public void setDateModified( Date dateModified )
    {
        this.dateModified = dateModified;
    }


    public String getGeneralLovId()
    {
        return generalLovId;
    }


    public void setGeneralLovId( String generalLovId )
    {
        this.generalLovId = generalLovId;
    }


    public GeneralLovTm getLovType()
    {
        return lovType;
    }


    public void setLovType( GeneralLovTm lovType )
    {
        this.lovType = lovType;
    }


    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += ( generalLovId != null ? generalLovId.hashCode() : 0 );
        return hash;
    }


    @Override
    public boolean equals( Object object )
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if ( !( object instanceof GeneralLov ) )
        {
            return false;
        }
        GeneralLov other = (GeneralLov) object;
        if ( ( this.generalLovId == null && other.generalLovId != null ) || ( this.generalLovId != null && !this.generalLovId.equals( other.generalLovId ) ) )
        {
            return false;
        }
        return true;
    }


    @Override
    public String toString()
    {
        return "idea.model.qnrlibrary.GeneralLov[ generalLovId=" + generalLovId + " ]";
    }
    
}
